// 统一请求路径前缀在libs/axios.js中修改
import {
  postRequest,
  postJsonRequest,
  apiUrl
}
from '@/utils/request.js';
let msgApi = {}

msgApi.uploadUrl = apiUrl + '/common/upload/uploadFile';
msgApi.uploadImage = apiUrl + '/common/upload/uploadImage';
// 上传头像
msgApi.uploadAvatar = apiUrl + '/common/upload/uploadAvatar';
// 上传人脉圈背景图
msgApi.uploadChatBg = apiUrl + '/common/upload/uploadChatBg';
/**
 * @desc 我的团队
 * @param {*} 参数 
 */
msgApi.team = (params) => {
  return postJsonRequest('/enterprise/common/team', params)
}

/**
 * @desc 回复列表
 * @param {*} 参数 
 */
msgApi.quickreplylist = (params) => {
  return postJsonRequest('/enterprise/common/quickreplylist', params)
}

/**
 * @desc 更新回复
 * @param {*} 参数 
 */
msgApi.quickreplyedit = (params) => {
  return postJsonRequest('/enterprise/common/quickreplyedit', params)
}

/**
 * @desc 删除回复
 * @param {*} 参数 
 */
msgApi.quickreplydel = (params) => {
  return postJsonRequest('/enterprise/common/quickreplydel', params)
}

/**
 * @desc 表情接口
 * @param {*} 参数 
 */
msgApi.emoji = (params) => {
  return postJsonRequest('/enterprise/common/emoji', params)
}

/**
 * @desc 贡献值明细
 * @param {*} 参数 
 */
msgApi.getpointlog = (params) => {
  return postJsonRequest('/enterprise/common/getpointlog', params)
}

/**
 * @desc 关闭临时聊天
 * @param {*} 参数 
 */
msgApi.closetmpchat = (params) => {
  return postJsonRequest('/enterprise/im/closetmpchat', params)
}

/**
 * @desc 获取临时聊天列表
 * @param {*} 参数 
 */
msgApi.getTmpContacts = (params) => {
  return postJsonRequest('/enterprise/im/getTmpContacts', params)
}

/**
 * @desc 普通消息列表（小程序）
 * @param {*} 参数 
 */
msgApi.initContacts = (params) => {
  return postJsonRequest('/enterprise/im/getContacts', params)
}

/**
 * @desc 开播
 * @param {*} 参数 
 */
msgApi.liveOpen = (params) => {
  return postJsonRequest('/enterprise/live/open', params)
}

/**
 * @desc 公开直播列表接口
 * @param {*} 参数 
 */
msgApi.liveData = (params) => {
  return postJsonRequest('/enterprise/live/data', params)
}

/**
 * @desc 隐藏好友信息
 * @param {*} 参数 
 */
msgApi.friendHide = (params) => {
  return postJsonRequest('/enterprise/friend/hide', params)
}

/**
 * @desc 账号注销申请
 * @param {*} 参数 
 */
msgApi.logoff = (params) => {
  return postJsonRequest('/enterprise/common/logoff', params)
}

/**
 * @desc 修改聊天背景
 * @param {*} 参数 
 */
msgApi.chatbgset = (params) => {
  return postJsonRequest('/enterprise/im/chatbgset', params)
}

/**
 * @desc 清空聊天记录
 * @param {*} 参数 
 */
msgApi.msglogclean = (params) => {
  return postJsonRequest('/enterprise/im/msglogclean', params)
}

/**
 * @desc 日期筛选列表接口
 * @param {*} 参数 
 */
msgApi.msglogdatelist = (params) => {
  return postJsonRequest('/enterprise/im/msglogdatelist', params)
}

/**
 * @desc 聊天明细接口
 * @param {*} 参数 
 */
msgApi.msglog = (params) => {
  return postJsonRequest('/enterprise/im/msglog', params)
}

/**
 * @desc 切换对方头像和昵称
 * @param {*} 参数 
 */
msgApi.userinfochange = (params) => {
  return postJsonRequest('/enterprise/im/userinfochange', params)
}

/**
 * @desc 是否可以被搜索
 * @param {*} 参数 
 */
msgApi.besearch = (params) => {
  return postJsonRequest('/enterprise/im/besearch', params)
}

/*
VIP续费配置
*/
msgApi.getMemberConfig = (params) => {
  return postJsonRequest('/common/Pub/memberrechargeconfig', params)
}

/*
VIP到期时间
*/
msgApi.getMemberexPire = (params) => {
  return postJsonRequest('/common/Pub/memberexpire', params)
}

/*
VIP支付
*/
msgApi.getMemberreCharge = (params) => {
  return postJsonRequest(`/common/Pub/memberrecharge?month=${params}`)
}

/**
 * @desc 普通消息列表（小程序）
 * @param {*} 参数 
 */
msgApi.getMessageList = (params) => {
  return postJsonRequest('/enterprise/im/getMessageList', params)
}

/**
 * @desc 问候功能 -- 获取发送记录
 * @param {*} 参数 
 */
msgApi.getGreeting = (params) => {
  return postJsonRequest('/enterprise/im/greeting', params)
}

/**
 * @desc 设置聊天置顶
 * @param {*} 参数 
 */
msgApi.setChatTopAPI = (params) => {
  return postJsonRequest('/enterprise/im/setChatTop', params)
}

/**
 * @desc 删除聊天
 * @param {*} 参数 
 */
msgApi.delChatAPI = (params) => {
  return postJsonRequest('/enterprise/im/delChat', params)
}

/**
 * @desc 群发的消息
 * @param {*} 参数 
 */
msgApi.greetingAdd = (params) => {
  return postJsonRequest('/enterprise/im/greetingadd', params)
}

/**
 * @desc 取消群发的消息
 * @param {*} 参数 
 */
msgApi.greetingCancel = (params) => {
  return postJsonRequest('/enterprise/im/greetingcancel', params)
}

/**
 * @desc 反馈接口
 * @param {*} 参数 
 */
msgApi.feedback = (params) => {
  return postJsonRequest('/enterprise/im/feedback', params)
}

/**
 * @desc 发送文本聊天消息
 * @param {*} 参数 
 */
msgApi.sendMessage = (params) => {
  return postJsonRequest('/enterprise/im/sendMessage', params)
}

/**
 * @desc 收藏消息
 * @param {*} 参数 
 */
msgApi.collectMessage = (params) => {
  return postJsonRequest('/enterprise/im/collectMessage', params)
}

/**
 * @desc 获取收藏消息列表
 * @param {*} 参数 
 */
msgApi.collectMessageList = (params) => {
  return postJsonRequest('/enterprise/im/collectMessageList', params)
}

/**
 * @desc 设置收藏密码
 * @param {*} 参数 
 */
msgApi.collectpwd = (params) => {
  return postJsonRequest('/enterprise/im/collectpwd', params)
}

/**
 * @desc 验证收藏密码
 * @param {*} 参数 
 */
msgApi.collectcheck = (params) => {
  return postJsonRequest('/enterprise/im/collectcheck', params)
}

/**
 * @desc 初始化放大基数
 * @param {*} 参数 
 */
msgApi.pagesize = (params) => {
  return postJsonRequest('/enterprise/im/pagesize', params)
}

/**
 * @desc 收藏消息
 * @param {*} 参数 
 */
msgApi.silent = (params) => {
  return postJsonRequest('/enterprise/im/silent', params)
}

/**
 * @desc 删除消息
 * @param {*} 参数 
 */
msgApi.removeMessage = (params) => {
  return postJsonRequest('/enterprise/im/removeMessage', params)
}

/**
 * @desc 转发聊天消息
 * @param {*} 参数 
 */
msgApi.forwardMessage = (params) => {
  return postJsonRequest('/enterprise/im/forwardMessage', params)
}

/**
 * @desc ai聊天
 * @param {*} 参数 
 */
msgApi.ai = (params) => {
  return postJsonRequest('/enterprise/common/ai', params)
}

/**
 * @desc 设置消息已读
 * @param {*} 参数 
 */
msgApi.setMsgIsRead = (params) => {
  return postJsonRequest('/enterprise/im/setMsgIsRead', params)
}

/**
 * 撤回消息
 * @param {*} data
 */
msgApi.undoMessage = (params) => {
  return postJsonRequest('/enterprise/im/undoMessage', params)
}

/**
 * 发送ws消息
 * @param {*} data
 */
msgApi.sendToMsg = (params) => {
  return postJsonRequest('/enterprise/im/sendToMsg', params)
}

/**
 * 发送ws消息 -- 群语音
 * @param {*} data
 */
msgApi.sendToGroupMsg = (params) => {
  return postJsonRequest('/enterprise/im/sendToGroupMsg', params)
}

/**
 * 消息免打扰
 * @param {*} data
 */
msgApi.isNoticeAPI = (params) => {
  return postJsonRequest('/enterprise/im/isNotice', params)
}

/**
 * 更新业务卡片
 * @param {*} data
 */
msgApi.updateCard = (params) => {
  return postJsonRequest('/enterprise/im/updateCard', params)
}

/**
 * 同意或者忽略团队
 * @param {*} data
 */
msgApi.joinGroup = (params) => {
  return postJsonRequest('/enterprise/group/joinGroup', params)
}

/**
 * 群昵称设置
 * @param {*} data
 */
msgApi.editGroupUserName = (params) => {
  return postJsonRequest('/enterprise/group/editGroupUserName', params)
}

/**
 * 获取群成员
 * @param {*} data
 */
msgApi.groupUserList = (params) => {
  return postJsonRequest('/enterprise/group/groupUserList', params)
}

/**
 * 修改群公告
 * @param {*} data
 */
msgApi.setNotice = (params) => {
  return postJsonRequest('/enterprise/group/setNotice', params)
}
/**
 * 群管理信息
 * @param {*} data
 */
msgApi.groupInfo = (params) => {
  return postJsonRequest('/enterprise/group/groupInfo', params)
}

/**
 * 加入群聊
 * @param {*} data
 */
msgApi.joinGroup = (params) => {
  return postJsonRequest('/enterprise/group/joinGroup', params)
}


/**
 * 修改群管理信息
 * @param {*} data
 */
msgApi.groupSetting = (params) => {
  return postJsonRequest('/enterprise/group/groupSetting', params)
}

/**
 * 转让管理权限
 * @param {*} data
 */
msgApi.changeOwner = (params) => {
  return postJsonRequest('/enterprise/group/changeOwner', params)
}

/**
 * 获取全部人员
 * @param {*} data
 */
msgApi.getAllUser = (params) => {
  return postJsonRequest('/enterprise/group/getAllUser', params)
}

/**
 * 创建群聊
 * @param {*} data
 */
msgApi.addGroup = (params) => {
  return postJsonRequest('/enterprise/group/add', params)
}
/**
 * 绑定群聊
 * @param {*} data
 */
msgApi.bindGroup = (params) => {
  return postJsonRequest('/common/index/bindGroup', params)
}

/**
 * 修改群聊名字
 * @param {*} data
 */
msgApi.editGroupName = (params) => {
  return postJsonRequest('/enterprise/group/editGroupName', params)
}
/**
 * 添加群成员
 * @param {*} data
 */
msgApi.addGroupUser = (params) => {
  return postJsonRequest('/enterprise/group/addGroupUser', params)
}

/**
 * 删除群成员
 * @param {*} data
 */
msgApi.removeUser = (params) => {
  return postJsonRequest('/enterprise/group/removeUser', params)
}

/**
 * 删除群聊
 * @param {*} data
 */
msgApi.removeGroup = (params) => {
  return postJsonRequest('/enterprise/group/removeGroup', params)
}


/**
 * 设置/取消 禁言
 * @param {*} data
 */
msgApi.setBanned = (params) => {
  return postJsonRequest('/enterprise/group/setBanned', params)
}


/**
 * 设置/取消管理员
 * @param {*} data
 */
msgApi.setManager = (params) => {
  return postJsonRequest('/enterprise/group/setManager', params)
}

/**
 * 查询是否禁言
 * @param {*} data
 */
msgApi.setOpenSpeech = (params) => {
  return postJsonRequest('/enterprise/group/openSpeech', params)
}

/**
 * 获取成员信息
 * @param {*} data
 */
msgApi.getUserInfo = (params) => {
  return postJsonRequest('/enterprise/im/getUserInfo', params)
}

// 搜索用户
msgApi.searchUser = (params) => {
  return postJsonRequest('enterprise/im/searchUser', params)
}

// 修改用户信息
msgApi.updateUserInfo = (params) => {
  return postJsonRequest('enterprise/im/updateUserInfo', params)
}

// 修改账号
msgApi.editAccount = (params) => {
  return postJsonRequest('enterprise/im/editAccount', params)
}

// 修改密码
msgApi.editPassword = (params) => {
  return postJsonRequest('enterprise/im/editPassword', params)
}

export default msgApi;